/**
 * 
 */
package com.fsharemobile.client;

import java.net.URL;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;

/**
 * @author RAD-Dungtm9
 * 
 */
public class HttpRequest {

	public HttpRequest() {
		super();
		addedHeaderFields = new HashMap<String, String>();
	}

	private Map<String, String> addedHeaderFields;

	private URL url;

	/**
	 * @return the url
	 */
	public URL getUrl() {
		return url;
	}

	/**
	 * @param url
	 *            the url to set
	 */
	public void setUrl(URL url) {
		this.url = url;
	}

	/**
	 * @return the headerFields
	 */
	public Map<String, String> getAddedHeaderFields() {
		return addedHeaderFields;
	}

	/**
	 * @param headerFields
	 *            the headerFields to set
	 */
	public void setAddedHeaderFields(Map<String, String> headerFields) {
		this.addedHeaderFields = headerFields;
	}

	/**
	 * @return the body
	 */
	public byte[] getBody() {
		return body;
	}

	/**
	 * @param body
	 *            the body to set
	 */
	public void setBody(byte[] body) {
		this.body = body;
	}

	public void setBody(String body) {
		this.body = body.getBytes(Charset.forName("UTF-8"));
	}

	private byte[] body = null;

}
